//
//  CellView.m
//  王宇先_06_通讯录
//
//  Created by wyx on 16/3/16.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "CellView.h"
#import "QuartzCore/QuartzCore.h"

@interface CellView ()

@end

@implementation CellView
-(void)dealloc{
    [_lableOfName release];
    [_viewOfCon release];
    [_lableOfNum release];
    [_view1 release];
    [super dealloc];
}
#pragma mark - create && init
- (instancetype)initWithFrame:(CGRect)frame withImage:(UIImage *)image withLableOfName:(NSString *)lableOfName withOfNameOfNum:(NSString *)lableOfNum   withView:(UIView *)view1 {
    self = [super initWithFrame:frame];
    if (self) {
        //创建子视图对象
        [self createSubViewWithFrame:frame];
        self.viewOfCon.image = image;
        self.lableOfName.text = lableOfName;
        self.lableOfNum.text = lableOfNum;
        self.view1 = view1;
        
    }
    return self;
}
#pragma mark - 创建子视图
- (void)createSubViewWithFrame:(CGRect)frame{//参数根据需求
    self.viewOfCon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width , 130)];
    self.viewOfCon.layer.borderWidth = 2;
    self.viewOfCon.layer.cornerRadius = 10;
    [self addSubview:self.viewOfCon];
    [_viewOfCon release];
    self.lableOfName = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.width  +10, 10, frame.size.width + 90 , 55)];
    self.lableOfName.layer.borderWidth = 2;
    self.lableOfName.layer.cornerRadius = 10;
    self.lableOfName.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.lableOfName];
    [_lableOfName release];
    self.lableOfNum = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.width  +10, 70, frame.size.width + 90, 55)];
    self.lableOfNum.layer.borderWidth = 2;
    self.lableOfNum.layer.cornerRadius = 10;
    self.lableOfNum.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.lableOfNum];
    [_lableOfName release];
    self.view1 = [[UIView alloc] initWithFrame:CGRectMake(20, frame.size.height +10, frame.size.width + 200, 1)];
    [self.view1 setBackgroundColor:[UIColor blackColor]];
    [self addSubview:self.view1];
    [_view1 release];
    
}
@end
